{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/json": "[\"ExportedQsharpCode\"]",
      "text/html": [
       "<ul><li>ExportedQsharpCode</li></ul>"
      ],
      "text/plain": [
       "ExportedQsharpCode"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "operation ExportedQsharpCode() : Result {\n",
    "        using(q_reg = Qubit[3]) {\n",
    "                X(q_reg[0]);\n",
    "                X(q_reg[1]);\n",
    "                X(q_reg[2]);\n",
    "                CCNOT(q_reg[0], q_reg[1], q_reg[2]);\n",
    "                let r = M(q_reg[2]);\n",
    "                ResetAll(q_reg);\n",
    "                return r;\n",
    "        }\n",
    "    }"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "0",
      "text/plain": [
       "Zero"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate ExportedQsharpCode"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Q#",
   "language": "qsharp",
   "name": "iqsharp"
  },
  "language_info": {
   "file_extension": ".qs",
   "mimetype": "text/x-qsharp",
   "name": "qsharp",
   "version": "0.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
